import React from 'react';
import ReactDOM from 'react-dom';
import './index.css';
import App from './App';
import * as serviceWorker from './serviceWorker';

import Test from './Test'
import test2 from './test2'

import store from './store/store.js';



// *监听store中的变化，来重新渲染页面
store.subscribe(() => {
  ReactDOM.render(
    <React.StrictMode>
      <App store={store} />
    </React.StrictMode>,
    document.getElementById('root')
  );
})

ReactDOM.render(
  <React.StrictMode>
    <App store={store} />
  </React.StrictMode>,
  document.getElementById('root')
);


//! 模拟Redux
// ReactDOM.render(<Test store={test2} />,document.getElementById('root'))

serviceWorker.unregister();
